// SPDX-License-Identifier: GPL-2.0
/*
 * FIXED MAPPING
 *
 * (C) 2024.05.01 BuddyZhang1 <buddy.zhang@aliyun.com>
 */
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/fixmap.h>

static int __init BiscuitOS_init(void)
{
	void *mem;

	/* FIXED MAPPING */
	mem = (void *)fix_to_virt(FIX_APIC_BASE);
	if (!mem) {
		printk("ERROR: FIXED FAILED\n");
		return -ENOMEM;
	}

	/* ACCESS */
	printk("%#lx\n", *(unsigned long *)mem);

	/* IGNORE UNMAPPING */
	;

	return 0;
}

static void __exit BiscuitOS_exit(void) { }

module_init(BiscuitOS_init);
module_exit(BiscuitOS_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("BiscuitOS <buddy.zhang@aliyun.com>");
MODULE_DESCRIPTION("Linux Dream Motion on BiscuitOS");
